from rest_framework import serializers

from recruit.models import *

class RecSe(serializers.ModelSerializer):
    class Meta:
        model = Recruit
        fields = '__all__'

class EntSer(serializers.ModelSerializer):
    recruits=RecSe(many=True)
    class Meta:
        model=Enterprise
        fields='__all__'

class RecSer(serializers.ModelSerializer):
    enterprise=EntSer()
    class Meta:
        model = Recruit
        fields = '__all__'
class EnterpriseVistSerializers(serializers.ModelSerializer):
    recruits=RecSer(many=True)
    class Meta:
        model=Enterprise
        fields='__all__'

class RecruitsNewSerializers(serializers.ModelSerializer):
    enterprise=EnterpriseVistSerializers()
    # users=serializers.StringRelatedField(source='User.id')
    class Meta:
        model=Recruit
        fields='__all__'

